#ifndef __CONFIG_H__
#define __CONFIG_H__

//////#include "grobal.h"
//////#include "nandtype.h"

//////#define min(x1,x2) (((x1)<(x2))? (x1):(x2))

//-------------pannel setting
//#define __LMS350
//#define __LMS430
//#define __LMS700

////////-------------MBR setting
//////#define _MBR_7 //MLC MBR 7 start, else 9 start
//////
//////#ifdef SUPPORTMLC //MLC setting
#define NAND_BLOCK_PAGE			128
//////#else //SLC setting
//////	#define NAND_BLOCK_PAGE			64
//////#endif
#define NAND_PAGE_SECTOR		4
#define NAND_PAGE_SIZE			NAND_PAGE_SECTOR*512
#define NAND_BLOCK_SIZE			NAND_BLOCK_PAGE*NAND_PAGE_SIZE

//////#ifdef SUPPORTMLC //MLC setting
//////	#define DL_TARGET_BLOCK			1		// downloader start block
//////	#define DL_MAX_BLOCKS           4
//////#else
//////	#define DL_TARGET_BLOCK			1		// downloader start block
//////	#define DL_MAX_BLOCKS           9
//////#endif
//////
//////#define UT_RESERVED_BLOCKS      2    	//reserve for UT bad block
//////
//////
//////#ifdef 	SUPPORTMLC //MLC setting
//////
//////	#ifdef  _MBR_7
//////		#define MBR_START_BLOCK			7
//////		#define RESERVED_BTMAC_TARGET   8
//////		#define RESERVED_VARS_TARGET    9
//////		#define INFO_START_BLOCK        10
//////	#else
//////		#define RESERVED_BTMAC_TARGET   7
//////		#define RESERVED_VARS_TARGET    8
//////		#define MBR_START_BLOCK			9
//////		#define INFO_START_BLOCK        10
//////	#endif
//////
//////		#define CE_START_BLOCK		    11
//////#else  //SLC setting
//////	#define MBR_START_BLOCK			14
//////	#define RESERVED_BTMAC_TARGET   15
//////	#define RESERVED_VARS_TARGET    16
//////	#define INFO_START_BLOCK        17
//////
//////	#define CE_START_BLOCK		    18
//////#endif
//////
//////
////////xyin0301 [
//////#define RESERVED_UTLOCK_TARGET   RESERVED_BTMAC_TARGET
//////#define UTLOCKSIGPAGE		0				//UT lock flag page offset number of the block
//////#define UTLOCKSIGOFFSET		0				//UT lock flag offset of the sector
////////#define UTLOCKSIGPOS		(UTLOCKSIGPAGE*NAND_PAGE_SIZE+UTLOCKSIGOFFSET)		//UT lock flag position of the block
//////#define UTLOCKSIG			"LOCKEDUT"		//UT locked sign
//////#define UTLOCKSIGLEN		sizeof(UTLOCKSIG)
//////#define _TESTTOOL 0
//////#define CONFIGBLOCKS		2
//////#define IBOOTCE_FLAG  (*(volatile unsigned *)0x00000ff0)//zep_0714
//////
////////xyin0301 ]
//////
////////---------CPLD ----------
////////#define CPLD_REVERSE  //changes 0215
//////
//////#define UT_RUN_ADDRESS (0x30000000)	// UpgradeTool must run at this address
//////#define IMG_DOWNLOAD_ADDRESS (0x30400000)	//changes 0214 for 2G FAT table // WinCE must run at this address
//////
//////#ifdef SDRAM32
//////	#define FRAMEBUF_VEND		(0x31ff0000) // see option.h		//gaojian
//////#else
//////	#define FRAMEBUF_VEND		(0x33ff0000) // see option.h		//gaojian
//////#endif
//////
//////#ifdef __LMS700
//////#define FRAMEBUF_VBASE		(FRAMEBUF_VEND - 0x200000) // framebuffer size = 320 * 240 * 16 / 8
//////#else
//////#define FRAMEBUF_VBASE		(FRAMEBUF_VEND - 0x96000) // framebuffer size = 320 * 240 * 16 / 8
//////#endif
//////
//////#define FRAMEBUF_PBASE		FRAMEBUF_VBASE
//////
//////#define IPL_RUN_ADDRESS		0x31e00000
//////
//////#define VA_BASE             0x8C000000  
//////
////////#define HEAPSTART ((Get_HeapStart()/16 + 1)*16) 
//////
//////#define HEAPEND	 IMG_DOWNLOAD_ADDRESS
//////#define HEAPSIZE  (HEAPEND - HEAPSTART)
//////
//////#define BTMAC_MAX_SIZE  32
//////
//////#define CE_MAX_SIZE (FRAMEBUF_PBASE-IMG_DOWNLOAD_ADDRESS) //changes 0308
////////#define CE_MAX_SIZE (IPL_RUN_ADDRESS-IMG_DOWNLOAD_ADDRESS)
//////
//////#define XIPKERNEL_FILE_SIZE		0x00200000  //Same as config.bib
//////
//////#define CHAIN_FILE_SIZE		0x00001000  //Same as config.bib

//nilson0508 start
/*
#define GPIO_JOGDAIL_ENTER		GPF0
#define GPIO_JOGDAIL_DOWN		GPG0
#define GPIO_USB_EN				GPA6
#define GPIO_FLASH_WP			GPB5

#define GPIO_LCD_ON				GPA8
#define GPIO_LCD_PWR_ON			GPL11
#define GPIO_BL_PWM				GPB0
#define GPIO_BL_ON				GPB6
*/
#define GPIO_JOGDAIL_ENTER		GPG0
#define GPIO_JOGDAIL_DOWN		GPG4
#define GPIO_USB_EN				GPA6
#define GPIO_FLASH_WP			GPB5

#define GPIO_LCD_ON				GPA8
#define GPIO_LCD_PWR_ON			GPL11
#define GPIO_BL_PWM				GPB0
#define GPIO_BL_ON				GPB6
//nilson0508 end
#define SERIAL_BAUD_RATE 115200

#define PRINTF_BUFFER_SIZE 512	// Max buffer size for printf output on screen or serial

//////#define IMAGE_SIG_LEN 16  //The size of file "sigbinfs" and "signormal"
//////
//////#define RUN_FROM_JTAG 0  //add by changes 20060126 for JTAG run code 

//------------- key setting
#define KEYDLYMAX 0xffffffff
#define KEYDLY  100000


#endif							// __CONFIG_H__
